package com.xy.farm.activity.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.xy.farm.R;
import com.xy.farm.activity.base.BaseFragment;
import com.xy.farm.activity.my.EditDataActivity;
import com.xy.farm.activity.my.MyAttentionActivity;
import com.xy.farm.activity.my.MyFansActivity;
import com.xy.farm.activity.my.MyHomeActivity;
import com.xy.farm.activity.my.MyLandActivity;
import com.xy.farm.activity.my.MyOrderActivity;
import com.xy.farm.activity.my.MyWalletActivity;
import com.xy.farm.activity.my.MyWarehouseActivity;
import com.xy.farm.activity.my.SettingActivity;
import com.xy.farm.activity.my.ShippingAddressActivity;

/**
 * Created by 1174607250 on 2018/8/5.
 */

public class MyFragment extends BaseFragment
{
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
    {
        View view = inflater.inflate(R.layout.fragment_my, container, false);
        view.findViewById(R.id.btn_setting).setOnClickListener(this);
        view.findViewById(R.id.btn_edit_data).setOnClickListener(this);
        view.findViewById(R.id.btn_my_home).setOnClickListener(this);
        view.findViewById(R.id.btn_my_fans).setOnClickListener(this);
        view.findViewById(R.id.btn_my_attention).setOnClickListener(this);
        view.findViewById(R.id.btn_my_wallet).setOnClickListener(this);
        view.findViewById(R.id.btn_my_warehouse).setOnClickListener(this);
        view.findViewById(R.id.btn_my_order).setOnClickListener(this);
        view.findViewById(R.id.btn_my_land).setOnClickListener(this);
        view.findViewById(R.id.btn_shipping_address).setOnClickListener(this);
        return view;

    }

    @Override
    public void onClick(View v)
    {
        super.onClick(v);
        Intent intent;
        switch (v.getId())
        {
            case R.id.btn_setting:
                intent = new Intent(getActivity(), SettingActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_edit_data:
                intent = new Intent(getActivity(), EditDataActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_my_home:
                intent = new Intent(getActivity(), MyHomeActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_my_fans:
                intent = new Intent(getActivity(), MyFansActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_my_attention:
                intent = new Intent(getActivity(), MyAttentionActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_my_wallet:
                intent = new Intent(getActivity(), MyWalletActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_my_warehouse:
                intent = new Intent(getActivity(), MyWarehouseActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_my_order:
                intent = new Intent(getActivity(), MyOrderActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_my_land:
                intent = new Intent(getActivity(), MyLandActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_shipping_address:
                intent = new Intent(getActivity(), ShippingAddressActivity.class);
                startActivity(intent);
                break;
        }
    }
}
